/*
    日志项目的基础功能测试
*/
#include <iostream>
#include "../logs/logging.h"

void test_Log()
{
    logging::logger::s_ptr p = logging::getLogger("sync-looper");
    int count = 0;
    while(count < 5000) {
        UNIQUE_DEBUG("sync-looper", "测试同步日志器-%d", count++);
        UNIQUE_INFO("sync-looper", "测试全局接口-%d", count++);
        UNIQUE_WARNNING("sync-looper", "测试全局接口-%d", count++);
        UNIQUE_ERROR("sync-looper", "测试全局接口-%d", count++);
        UNIQUE_FATAL("sync-looper", "测试全局接口-%d", count++);
    }
}

int main()
{
    logging::globalLoggerBuilder llb;
    llb.buildEnableUnsafe();
    llb.buildFormatter();
    llb.buildLimitRank(logging::logLevel::value::DEBUG);
    llb.buildLoggerName("sync-looper");
    llb.buildLoggerType(logging::loggerType::SYNC_LOGGER);
    llb.buildSinks<logging::stdoutSink>();
    llb.buildSinks<logging::fileSink>("./file-log/file.log");
    llb.buildSinks<logging::rollSinkBySize>("./file-log/async-looper-", 1024);
    logging::logger::s_ptr async_logger = llb.build();

    test_Log();

    return 0;
}
